Import SDK to DevEco Studio


Add SDK to DevEco Studio for HarmonyOS NEXT project

  1. Download/Copy the HarmonyOS NEXT SDK (UniPRT.har) to some local directory on your PC.
  2. Create a project via DevEco Studio.
    1. Add “import” statements for the required components from the library at top of ArkTS code files.(*.ets)
      e.g. import {IComm, BTClassicConnection, TcpConnection, UsbConnection, BLEConnection} from 'uniprt'
  3. Once the project is created, modify the project-level oh-package.json5:
    • Add a implementation of the SDK path in the dependencies field. e.g.
      dependencies {
          "uniprt": "file:./entry/libs/UniPRT.har"
      }
  4. Copy the SDK to {Project}/entry/libs folder. e.g. "MyApplication/entry/libs"
  5. Sync and Refresh Project with oh-package.json5 files.